```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>消息堆积问题全解析 - 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        .serif {
            font-family: 'Noto Serif SC', serif;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
        }
        .highlight-code {
            background-color: #f8f8f8;
            border-left: 4px solid #6e8efb;
        }
        .topic-tag {
            transition: all 0.2s ease;
        }
        .topic-tag:hover {
            background-color: #6e8efb;
            color: white;
        }
        .section-divider {
            border: none;
            height: 1px;
            background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1), transparent);
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <header class="hero-gradient text-white py-20 px-4 md:py-32">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0 md:pr-10">
                    <h1 class="serif text-4xl md:text-5xl font-bold mb-6 leading-tight">消息堆积问题全解析</h1>
                    <p class="text-xl opacity-90 mb-8">从原因到解决方案的完整指南</p>
                    <div class="flex space-x-4">
                        <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">消息队列</span>
                        <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">性能优化</span>
                        <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">分布式系统</span>
                    </div>
                </div>
                <div class="md:w-1/2">
                    <div class="bg-white bg-opacity-10 p-6 rounded-xl backdrop-blur-sm">
                        <h3 class="text-xl font-semibold mb-4">关键知识点概览</h3>
                        <ul class="space-y-3">
                            <li class="flex items-start">
                                <i class="fas fa-exclamation-triangle text-yellow-300 mt-1 mr-3"></i>
                                <span>4类常见堆积原因分析</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-bolt text-blue-300 mt-1 mr-3"></i>
                                <span>5种紧急处理措施</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-shield-alt text-green-300 mt-1 mr-3"></i>
                                <span>5大长期预防方案</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-code text-purple-300 mt-1 mr-3"></i>
                                <span>实用代码示例</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </header>

    <!-- Main Content -->
    <main class="container mx-auto max-w-6xl px-4 py-12">
        <!-- Introduction -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8 mb-8 card-hover">
                <h2 class="serif text-3xl font-bold mb-6 text-gray-800">什么是消息堆积？</h2>
                <p class="text-lg text-gray-700 mb-6">消息堆积是指生产者发送消息的速率超过了消费者消费消息的速率，导致消息在Broker中积压，无法被及时处理。这种现象在分布式系统中十分常见，但如果不及时处理，可能导致系统性能下降甚至崩溃。</p>
                
                <div class="mermaid mb-6">
                    graph LR
                    A[生产者] -->|发送消息| B[消息队列 Broker]
                    B -->|消费消息| C[消费者]
                    style A fill:#6e8efb,color:white
                    style B fill:#a777e3,color:white
                    style C fill:#4facfe,color:white
                </div>
                
                <p class="text-gray-600">本指南将全面解析消息堆积的常见原因、紧急处理措施以及长期预防方案，帮助您构建更健壮的消息处理系统。</p>
            </div>
        </section>

        <!-- Causes Section -->
        <section class="mb-20">
            <h2 class="serif text-3xl font-bold mb-8 text-gray-800 flex items-center">
                <i class="fas fa-search mr-4 text-blue-500"></i>
                <span>导致消息堆积的常见原因</span>
            </h2>
            
            <div class="grid md:grid-cols-2 gap-8">
                <!-- Cause 1 -->
                <div class="bg-white rounded-xl shadow-md p-6 card-hover border-t-4 border-blue-500">
                    <div class="flex items-center mb-4">
                        <div class="bg-blue-100 text-blue-600 p-3 rounded-full mr-4">
                            <i class="fas fa-tachometer-alt fa-lg"></i>
                        </div>
                        <h3 class="text-xl font-semibold">1. 消费者处理能力不足</h3>
                    </div>
                    <ul class="space-y-3 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-code text-blue-400 mt-1 mr-2 text-xs"></i>
                            <span>消费逻辑耗时过长，包含复杂计算或远程调用</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-server text-blue-400 mt-1 mr-2 text-xs"></i>
                            <span>消费者数量不足，实例少于Topic队列数</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-cog text-blue-400 mt-1 mr-2 text-xs"></i>
                            <span>线程池配置不合理，资源竞争严重</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-boxes text-blue-400 mt-1 mr-2 text-xs"></i>
                            <span>批量消费配置不当，实际吞吐量降低</span>
                        </li>
                    </ul>
                </div>
                
                <!-- Cause 2 -->
                <div class="bg-white rounded-xl shadow-md p-6 card-hover border-t-4 border-purple-500">
                    <div class="flex items-center mb-4">
                        <div class="bg-purple-100 text-purple-600 p-3 rounded-full mr-4">
                            <i class="fas fa-chart-line fa-lg"></i>
                        </div>
                        <h3 class="text-xl font-semibold">2. 生产峰值或突发流量</h3>
                    </div>
                    <ul class="space-y-3 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-bolt text-purple-400 mt-1 mr-2 text-xs"></i>
                            <span>促销活动、秒杀等导致流量突增</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-redo text-purple-400 mt-1 mr-2 text-xs"></i>
                            <span>系统重启后消息积压未及时处理</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-exclamation-triangle text-purple-400 mt-1 mr-2 text-xs"></i>
                            <span>生产者异常恢复产生突发流量</span>
                        </li>
                    </ul>
                </div>
                
                <!-- Cause 3 -->
                <div class="bg-white rounded-xl shadow-md p-6 card-hover border-t-4 border-orange-500">
                    <div class="flex items-center mb-4">
                        <div class="bg-orange-100 text-orange-600 p-3 rounded-full mr-4">
                            <i class="fas fa-microchip fa-lg"></i>
                        </div>
                        <h3 class="text-xl font-semibold">3. 系统资源瓶颈</h3>
                    </div>
                    <ul class="space-y-3 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-memory text-orange-400 mt-1 mr-2 text-xs"></i>
                            <span>CPU、内存、磁盘IO等硬件资源限制</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-project-diagram text-orange-400 mt-1 mr-2 text-xs"></i>
                            <span>消费者与其他应用共享资源导致竞争</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-database text-orange-400 mt-1 mr-2 text-xs"></i>
                            <span>Broker配置不合理，负载不均衡</span>
                        </li>
                    </ul>
                </div>
                
                <!-- Cause 4 -->
                <div class="bg-white rounded-xl shadow-md p-6 card-hover border-t-4 border-red-500">
                    <div class="flex items-center mb-4">
                        <div class="bg-red-100 text-red-600 p-3 rounded-full mr-4">
                            <i class="fas fa-bug fa-lg"></i>
                        </div>
                        <h3 class="text-xl font-semibold">4. 消费者异常和故障</h3>
                    </div>
                    <ul class="space-y-3 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-exclamation-circle text-red-400 mt-1 mr-2 text-xs"></i>
                            <span>消费逻辑中存在bug，频繁抛出异常</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-unlink text-red-400 mt-1 mr-2 text-xs"></i>
                            <span>依赖服务故障导致处理阻塞</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-power-off text-red-400 mt-1 mr-2 text-xs"></i>
                            <span>消费者宕机或重启导致负载不均</span>
                        </li>
                    </ul>
                </div>
            </div>
        </section>

        <hr class="section-divider my-12">

        <!-- Emergency Measures -->
        <section class="mb-20">
            <h2 class="serif text-3xl font-bold mb-8 text-gray-800 flex items-center">
                <i class="fas fa-fire-extinguisher mr-4 text-red-500"></i>
                <span>处理消息堆积的紧急措施</span>
            </h2>
            
            <div class="grid md:grid-cols-3 gap-8">
                <!-- Measure 1 -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="bg-blue-600 text-white p-4">
                        <h3 class="text-lg font-semibold flex items-center">
                            <i class="fas fa-user-plus mr-2"></i>
                            提升消费能力
                        </h3>
                    </div>
                    <div class="p-5">
                        <h4 class="font-medium text-gray-800 mb-3">扩容消费者实例</h4>
                        <div class="highlight-code p-4 rounded mb-4 overflow-x-auto">
                            <code class="text-sm text-gray-800">
# 使用Kubernetes快速扩容<br>
kubectl scale deployment consumer-app --replicas=10<br><br>
# 设置自动扩缩容<br>
kubectl autoscale deployment consumer-app --min=3 --max=20 --cpu-percent=70
                            </code>
                        </div>
                        <h4 class="font-medium text-gray-800 mb-3">优化线程池配置</h4>
                        <div class="highlight-code p-4 rounded overflow-x-auto">
                            <code class="text-sm text-gray-800">
// 调整消费者线程池大小<br>
consumer.setConsumeThreadMin(20);<br>
consumer.setConsumeThreadMax(50);
                            </code>
                        </div>
                    </div>
                </div>
                
                <!-- Measure 2 -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="bg-purple-600 text-white p-4">
                        <h3 class="text-lg font-semibold flex items-center">
                            <i class="fas fa-memory mr-2"></i>
                            临时扩容资源
                        </h3>
                    </div>
                    <div class="p-5">
                        <h4 class="font-medium text-gray-800 mb-3">增加硬件资源</h4>
                        <ul class="space-y-2 mb-4 text-gray-700">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-500 mr-2 mt-1 text-xs"></i>
                                <span>提升消费者机器配置（CPU/内存）</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-500 mr-2 mt-1 text-xs"></i>
                                <span>增加Broker节点，分散压力</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-500 mr-2 mt-1 text-xs"></i>
                                <span>优化网络带宽配置</span>
                            </li>
                        </ul>
                        <h4 class="font-medium text-gray-800 mb-3">调整JVM参数</h4>
                        <div class="highlight-code p-4 rounded overflow-x-auto">
                            <code class="text-sm text-gray-800">
# 增加JVM堆内存<br>
java -Xms4g -Xmx8g -jar consumer-application.jar<br><br>
# 优化GC策略<br>
java -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -jar consumer-application.jar
                            </code>
                        </div>
                    </div>
                </div>
                
                <!-- Measure 3 -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="bg-green-600 text-white p-4">
                        <h3 class="text-lg font-semibold flex items-center">
                            <i class="fas fa-filter mr-2"></i>
                            消息分流与过滤
                        </h3>
                    </div>
                    <div class="p-5">
                        <h4 class="font-medium text-gray-800 mb-3">优先级处理</h4>
                        <ul class="space-y-2 mb-4 text-gray-700">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mr-2 mt-1 text-xs"></i>
                                <span>优先处理重要业务消息</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mr-2 mt-1 text-xs"></i>
                                <span>延后处理不重要的消息</span>
                            </li>
                        </ul>
                        <h4 class="font-medium text-gray-800 mb-3">代码示例</h4>
                        <div class="highlight-code p-4 rounded overflow-x-auto">
                            <code class="text-sm text-gray-800">
public ConsumeConcurrentlyStatus consumeMessage(<br>
    List&lt;MessageExt&gt; msgs, ConsumeConcurrentlyContext context) {<br>
    <span class="text-gray-400">// 跳过非核心业务消息</span><br>
    for (MessageExt msg : msgs) {<br>
        if (isLowPriorityMessage(msg)) continue;<br>
        processMessage(msg);<br>
    }<br>
    return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;<br>
}
                            </code>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <hr class="section-divider my-12">

        <!-- Long-term Solutions -->
        <section class="mb-16">
            <h2 class="serif text-3xl font-bold mb-8 text-gray-800 flex items-center">
                <i class="fas fa-shield-alt mr-4 text-indigo-600"></i>
                <span>预防消息堆积的长期解决方案</span>
            </h2>
            
            <div class="space-y-8">
                <!-- Solution 1 -->
                <div class="bg-white rounded-xl shadow-md p-6 card-hover border-l-4 border-blue-500">
                    <div class="flex items-start">
                        <div class="bg-blue-100 text-blue-600 p-3 rounded-full mr-4 flex-shrink-0">
                            <i class="fas fa-sitemap fa-lg"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-3">1. 合理的系统架构设计</h3>
                            <ul class="space-y-2 text-gray-700">
                                <li class="flex items-start">
                                    <i class="fas fa-check text-blue-400 mr-2 mt-1 text-xs"></i>
                                    <span>根据业务特性分拆Topic，设置合适的队列数</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-check text-blue-400 mr-2 mt-1 text-xs"></i>
                                    <span>实现生产限流机制，避免流量突增</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-check text-blue-400 mr-2 mt-1 text-xs"></i>
                                    <span>将耗时操作异步化，多级消息处理链</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                
                <!-- Solution 2 -->
                <div class="bg-white rounded-xl shadow-md p-6 card-hover border-l-4 border-purple-500">
                    <div class="flex items-start">
                        <div class="bg-purple-100 text-purple-600 p-3 rounded-full mr-4 flex-shrink-0">
                            <i class="fas fa-tachometer-alt fa-lg"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-3">2. 消费端性能优化</h3>
                            <ul class="space-y-2 text-gray-700">
                                <li class="flex items-start">
                                    <i class="fas fa-check text-purple-400 mr-2 mt-1 text-xs"></i>
                                    <span>优化消费逻辑，避免慢操作</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-check text-purple-400 mr-2 mt-1 text-xs"></i>
                                    <span>不同业务使用不同的消费组</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-check text-purple-400 mr-2 mt-1 text-xs"></i>
                                    <span>实现基于积压量的自动扩缩容</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                
                <!-- Solution 3 -->
                <div class="bg-white rounded-xl shadow-md p-6 card-hover border-l-4 border-green-500">
                    <div class="flex items-start">
                        <div class="bg-green-100 text-green-600 p-3 rounded-full mr-4 flex-shrink-0">
                            <i class="fas fa-chart-line fa-lg"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-3">3. 监控与预警体系</h3>
                            <ul class="space-y-2 text-gray-700">
                                <li class="flex items-start">
                                    <i class="fas fa-check text-green-400 mr-2 mt-1 text-xs"></i>
                                    <span>监控消息积压量、生产消费速率对比</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-check text-green-400 mr-2 mt-1 text-xs"></i>
                                    <span>设置消息堆积量阈值告警</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-check text-green-400 mr-2 mt-1 text-xs"></i>
                                    <span>建立趋势分析系统，预测消息峰值</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                
                <!-- Solution 4 -->
                <div class="bg-white rounded-xl shadow-md p-6 card-hover border-l-4 border-yellow-500">
                    <div class="flex items-start">
                        <div class="bg-yellow-100 text-yellow-600 p-3 rounded-full mr-4 flex-shrink-0">
                            <i class="fas fa-shield-virus fa-lg"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-3">4. 容灾与降级策略</h3>
                            <ul class="space-y-2 text-gray-700">
                                <li class="flex items-start">
                                    <i class="fas fa-check text-yellow-500 mr-2 mt-1 text-xs"></i>
                                    <span>实现请求排队和流控机制</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-check text-yellow-500 mr-2 mt-1 text-xs"></i>
                                    <span>设置业务降级开关，简化异常处理</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-check text-yellow-500 mr-2 mt-1 text-xs"></i>
                                    <span>错峰处理重型批处理任务</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                
                <!-- Solution 5 -->
                <div class="bg-white rounded-xl shadow-md p-6 card-hover border-l-4 border-red-500">
                    <div class="flex items-start">
                        <div class="bg-red-100 text-red-600 p-3 rounded-full mr-4 flex-shrink-0">
                            <i class="fas fa-lightbulb fa-lg"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-3">5. 最佳实践与优化建议</h3>
                            <ul class="space-y-2 text-gray-700">
                                <li class="flex items-start">
                                    <i class="fas fa-check text-red-400 mr-2 mt-1 text-xs"></i>
                                    <span>生产者使用异步发送降低等待</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-check text-red-400 mr-2 mt-1 text-xs"></i>
                                    <span>保持消费逻辑简单高效</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-check text-red-400 mr-2 mt-1 text-xs"></i>
                                    <span>建立消息治理规范和应急流程</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Summary -->
        <section class="mb-16">
            <div class="bg-indigo-50 rounded-xl p-8">
                <h2 class="serif text-2xl font-bold mb-4 text-indigo-800">关键总结</h2>
                <div class="grid md:grid-cols-2 gap-8">
                    <div>
                        <h3 class="font-semibold text-indigo-700 mb-3 flex items-center">
                            <i class="fas fa-exclamation-circle mr-2"></i>
                            紧急处理重点
                        </h3>
                        <ul class="space-y-3 text-indigo-900">
                            <li class="flex items-start">
                                <div class="bg-indigo-100 text-indigo-600 rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0 text-xs">1</div>
                                <span>优先扩容消费者实例和调整线程池</span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-indigo-100 text-indigo-600 rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0 text-xs">2</div>
                                <span>临时过滤非核心消息，降低处理压力</span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-indigo-100 text-indigo-600 rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0 text-xs">3</div>
                                <span>必要时将消息转储到备用系统</span>
                            </li>
                        </ul>
                    </div>
                    <div>
                        <h3 class="font-semibold text-indigo-700 mb-3 flex items-center">
                            <i class="fas fa-shield-alt mr-2"></i>
                            长期预防重点
                        </h3>
                        <ul class="space-y-3 text-indigo-900">
                            <li class="flex items-start">
                                <div class="bg-indigo-100 text-indigo-600 rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0 text-xs">1</div>
                                <span>合理设计Topic和队列，实现生产限流</span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-indigo-100 text-indigo-600 rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0 text-xs">2</div>
                                <span>建立完善的监控和预警系统</span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-indigo-100 text-indigo-600 rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0 text-xs">3</div>
                                <span>制定容灾降级策略和应急预案</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-12 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-6 md:mb-0">
                    <h3 class="text-xl font-bold text-white mb-2">技术小馆</h3>
                    <p class="text-gray-400">分布式系统与消息队列专家</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition-colors duration-300 flex items-center">
                        <i class="fas fa-book-open mr-2"></i>
                        访问技术小馆语雀
                    </a>
                </div>
            </div>
            <div class="mt-8 pt-8 border-t border-gray-800 text-center text-gray-500 text-sm">
                &copy; 2023 技术小馆. 版权所有.
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
        
        // 平滑滚动效果
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });
    </script>
</body>
</html>
```